﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic" xmlns:CustomControl="clr-namespace:ScrumTable.UI.View.WinTouch.CustomControl">

 

    <Style TargetType="{x:Type Custom:SurfaceScrollViewer}" x:Key="ScrollViewerStyle">
        <Setter Property="Elasticity" Value="0.4,0.4"/>
        <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollViewer}">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" OpacityMask="{x:Null}" VerticalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="PART_ElasticBorder" Background="{TemplateBinding Background}">
                            <ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" Grid.ColumnSpan="1" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="-1" OpacityMask="{x:Null}" Grid.Row="0" Grid.RowSpan="1"/>
                        </Border>
                        <Custom:SurfaceScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Grid.Column="0" Foreground="{x:Null}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Height="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled" LargeChange="1" Maximum="{TemplateBinding ScrollableWidth}" MinWidth="30" Minimum="0" MinHeight="30" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" VerticalContentAlignment="Stretch">
                            <Custom:SurfaceScrollBar.Style>
                                <Style TargetType="{x:Type Custom:SurfaceScrollBar}">
                                    <Style.Resources>
                                        <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                                        <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                                    </Style.Resources>
                                    <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                                    <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                                    <Setter Property="BorderBrush" Value="#33000000"/>
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                <GradientStop Color="#33364E5C" Offset="0"/>
                                                <GradientStop Color="#0C364E5C" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Width" Value="30"/>
                                    <Setter Property="MinWidth" Value="30"/>
                                    <Setter Property="Height" Value="Auto"/>
                                    <Setter Property="MinHeight" Value="30"/>
                                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                <ControlTemplate.Resources>
                                                    <Storyboard x:Key="Touch">
                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                        <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                    </Storyboard>
                                                    <Storyboard x:Key="Release">
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                    </Storyboard>
                                                </ControlTemplate.Resources>
                                                <Grid x:Name="GridRoot" Background="Transparent" HorizontalAlignment="Stretch" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True" Width="Auto">
                                                    <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="8"/>
                                                    <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True">
                                                        <Track x:Name="PART_Track" IsDirectionReversed="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                            <Track.DecreaseRepeatButton>
                                                                <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageUpCommand" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceRepeatButton.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                            <Setter Property="Background" Value="{x:Null}"/>
                                                                            <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                            <Setter Property="IsTabStop" Value="False"/>
                                                                            <Setter Property="Focusable" Value="False"/>
                                                                            <Setter Property="Interval" Value="300"/>
                                                                            <Setter Property="Padding" Value="-5"/>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                        <Grid>
                                                                                            <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                        </Grid>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceRepeatButton.Style>
                                                                </Custom:SurfaceRepeatButton>
                                                            </Track.DecreaseRepeatButton>
                                                            <Track.IncreaseRepeatButton>
                                                                <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageDownCommand" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceRepeatButton.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                            <Setter Property="Background" Value="{x:Null}"/>
                                                                            <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                            <Setter Property="IsTabStop" Value="False"/>
                                                                            <Setter Property="Focusable" Value="False"/>
                                                                            <Setter Property="Interval" Value="300"/>
                                                                            <Setter Property="Padding" Value="-5"/>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                        <Grid>
                                                                                            <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                        </Grid>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceRepeatButton.Style>
                                                                </Custom:SurfaceRepeatButton>
                                                            </Track.IncreaseRepeatButton>
                                                            <Track.Thumb>
                                                                <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceThumb.BorderBrush>
                                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                            <GradientStop Color="#66000000" Offset="0"/>
                                                                            <GradientStop Color="#33000000" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Custom:SurfaceThumb.BorderBrush>
                                                                    <Custom:SurfaceThumb.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                            <Setter Property="Background">
                                                                                <Setter.Value>
                                                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                        <GradientStop Color="#66000000" Offset="0"/>
                                                                                        <GradientStop Color="#33000000" Offset="1"/>
                                                                                    </LinearGradientBrush>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                            <Setter Property="BorderBrush">
                                                                                <Setter.Value>
                                                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                        <GradientStop Color="#19000000" Offset="1"/>
                                                                                    </LinearGradientBrush>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                        <ControlTemplate.Resources>
                                                                                            <Storyboard x:Key="Press">
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                            </Storyboard>
                                                                                            <Storyboard x:Key="Release">
                                                                                                <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                            </Storyboard>
                                                                                        </ControlTemplate.Resources>
                                                                                        <Grid x:Name="Grid" Background="Transparent" Height="Auto" SnapsToDevicePixels="True" Width="{TemplateBinding MinWidth}">
                                                                                            <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch"/>
                                                                                            <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Height="Auto" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                                <Rectangle.Fill>
                                                                                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                                                        <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                        <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Rectangle.Fill>
                                                                                                <Rectangle.Stroke>
                                                                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                        <GradientStop Color="#19000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Rectangle.Stroke>
                                                                                            </Rectangle>
                                                                                            <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                        </Grid>
                                                                                        <ControlTemplate.Triggers>
                                                                                            <Trigger Property="IsFocused" Value="True"/>
                                                                                            <Trigger Property="IsDragging" Value="True">
                                                                                                <Trigger.EnterActions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                            <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </Trigger.EnterActions>
                                                                                                <Trigger.ExitActions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                            <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </Trigger.ExitActions>
                                                                                            </Trigger>
                                                                                            <Trigger Property="IsEnabled" Value="False">
                                                                                                <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                            </Trigger>
                                                                                        </ControlTemplate.Triggers>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceThumb.Style>
                                                                </Custom:SurfaceThumb>
                                                            </Track.Thumb>
                                                        </Track>
                                                    </Border>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                        <Trigger.EnterActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </Trigger.EnterActions>
                                                        <Trigger.ExitActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </Trigger.ExitActions>
                                                    </Trigger>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                        <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                        <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                        <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Style.Triggers>
                                        <Trigger Property="Orientation" Value="Horizontal">
                                            <Setter Property="Width" Value="Auto"/>
                                            <Setter Property="MinWidth" Value="30"/>
                                            <Setter Property="Height" Value="30"/>
                                            <Setter Property="MinHeight" Value="30"/>
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#33364E5C" Offset="0"/>
                                                        <GradientStop Color="#0C364E5C" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="VerticalAlignment" Value="Stretch"/>
                                            <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                        <ControlTemplate.Resources>
                                                            <Storyboard x:Key="Touch">
                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                            </Storyboard>
                                                            <Storyboard x:Key="Release">
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                            </Storyboard>
                                                        </ControlTemplate.Resources>
                                                        <Grid x:Name="GridRoot" Background="Transparent" Height="Auto" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True">
                                                            <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="8" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="Auto"/>
                                                            <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                <Track x:Name="PART_Track" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                    <Track.DecreaseRepeatButton>
                                                                        <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageLeftCommand" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceRepeatButton.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                    <Setter Property="IsTabStop" Value="False"/>
                                                                                    <Setter Property="Focusable" Value="False"/>
                                                                                    <Setter Property="Interval" Value="300"/>
                                                                                    <Setter Property="Padding" Value="-5"/>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                <Grid>
                                                                                                    <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceRepeatButton.Style>
                                                                        </Custom:SurfaceRepeatButton>
                                                                    </Track.DecreaseRepeatButton>
                                                                    <Track.IncreaseRepeatButton>
                                                                        <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageRightCommand" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceRepeatButton.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                    <Setter Property="IsTabStop" Value="False"/>
                                                                                    <Setter Property="Focusable" Value="False"/>
                                                                                    <Setter Property="Interval" Value="300"/>
                                                                                    <Setter Property="Padding" Value="-5"/>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                <Grid>
                                                                                                    <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceRepeatButton.Style>
                                                                        </Custom:SurfaceRepeatButton>
                                                                    </Track.IncreaseRepeatButton>
                                                                    <Track.Thumb>
                                                                        <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceThumb.BorderBrush>
                                                                                <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                                                </LinearGradientBrush>
                                                                            </Custom:SurfaceThumb.BorderBrush>
                                                                            <Custom:SurfaceThumb.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                    <Setter Property="Background">
                                                                                        <Setter.Value>
                                                                                            <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                <GradientStop Color="#66000000" Offset="0"/>
                                                                                                <GradientStop Color="#33000000" Offset="1"/>
                                                                                            </LinearGradientBrush>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                    <Setter Property="BorderBrush">
                                                                                        <Setter.Value>
                                                                                            <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                <GradientStop Color="#19000000" Offset="1"/>
                                                                                            </LinearGradientBrush>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                <ControlTemplate.Resources>
                                                                                                    <Storyboard x:Key="Press">
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                        <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                    </Storyboard>
                                                                                                    <Storyboard x:Key="Release">
                                                                                                        <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                        <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                    </Storyboard>
                                                                                                </ControlTemplate.Resources>
                                                                                                <Grid x:Name="Grid" Background="Transparent" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Width="Auto">
                                                                                                    <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                                    <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch" Width="Auto">
                                                                                                        <Rectangle.Fill>
                                                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                                                <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Rectangle.Fill>
                                                                                                        <Rectangle.Stroke>
                                                                                                            <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                                                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                <GradientStop Color="#19000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Rectangle.Stroke>
                                                                                                    </Rectangle>
                                                                                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                </Grid>
                                                                                                <ControlTemplate.Triggers>
                                                                                                    <Trigger Property="IsFocused" Value="True"/>
                                                                                                    <Trigger Property="IsDragging" Value="True">
                                                                                                        <Trigger.EnterActions>
                                                                                                            <BeginStoryboard>
                                                                                                                <Storyboard>
                                                                                                                    <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                    <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                </Storyboard>
                                                                                                            </BeginStoryboard>
                                                                                                        </Trigger.EnterActions>
                                                                                                        <Trigger.ExitActions>
                                                                                                            <BeginStoryboard>
                                                                                                                <Storyboard>
                                                                                                                    <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                    <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                </Storyboard>
                                                                                                            </BeginStoryboard>
                                                                                                        </Trigger.ExitActions>
                                                                                                    </Trigger>
                                                                                                    <Trigger Property="IsEnabled" Value="False">
                                                                                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                    </Trigger>
                                                                                                </ControlTemplate.Triggers>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceThumb.Style>
                                                                        </Custom:SurfaceThumb>
                                                                    </Track.Thumb>
                                                                </Track>
                                                            </Border>
                                                        </Grid>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                <Trigger.EnterActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </Trigger.EnterActions>
                                                                <Trigger.ExitActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </Trigger.ExitActions>
                                                            </Trigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                                <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Custom:SurfaceScrollBar.Style>
                        </Custom:SurfaceScrollBar>
                        <Custom:SurfaceScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Grid.Column="1" Foreground="{x:Null}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" IsEnabled="True" LargeChange="1" Maximum="{TemplateBinding ScrollableHeight}" MinWidth="30" Minimum="0" MinHeight="30" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" VerticalContentAlignment="Stretch" Width="Auto">
                            <Custom:SurfaceScrollBar.Style>
                                <Style TargetType="{x:Type Custom:SurfaceScrollBar}">
                                    <Style.Resources>
                                        <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                                        <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                                    </Style.Resources>
                                    <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                                    <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                                    <Setter Property="BorderBrush" Value="#33000000"/>
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                <GradientStop Color="#33364E5C" Offset="0"/>
                                                <GradientStop Color="#0C364E5C" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Width" Value="30"/>
                                    <Setter Property="MinWidth" Value="30"/>
                                    <Setter Property="Height" Value="Auto"/>
                                    <Setter Property="MinHeight" Value="30"/>
                                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                <ControlTemplate.Resources>
                                                    <Storyboard x:Key="Touch">
                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                        <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                        <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                    </Storyboard>
                                                    <Storyboard x:Key="Release">
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                        <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                    </Storyboard>
                                                </ControlTemplate.Resources>
                                                <Grid x:Name="GridRoot" Background="Transparent" HorizontalAlignment="Stretch" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True" Width="Auto">
                                                    <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="8"/>
                                                    <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True">
                                                        <Track x:Name="PART_Track" IsDirectionReversed="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                            <Track.DecreaseRepeatButton>
                                                                <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageUpCommand" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceRepeatButton.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                            <Setter Property="Background" Value="{x:Null}"/>
                                                                            <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                            <Setter Property="IsTabStop" Value="False"/>
                                                                            <Setter Property="Focusable" Value="False"/>
                                                                            <Setter Property="Interval" Value="300"/>
                                                                            <Setter Property="Padding" Value="-5"/>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                        <Grid>
                                                                                            <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                        </Grid>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceRepeatButton.Style>
                                                                </Custom:SurfaceRepeatButton>
                                                            </Track.DecreaseRepeatButton>
                                                            <Track.IncreaseRepeatButton>
                                                                <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageDownCommand" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceRepeatButton.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                            <Setter Property="Background" Value="{x:Null}"/>
                                                                            <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                            <Setter Property="IsTabStop" Value="False"/>
                                                                            <Setter Property="Focusable" Value="False"/>
                                                                            <Setter Property="Interval" Value="300"/>
                                                                            <Setter Property="Padding" Value="-5"/>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                        <Grid>
                                                                                            <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                        </Grid>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceRepeatButton.Style>
                                                                </Custom:SurfaceRepeatButton>
                                                            </Track.IncreaseRepeatButton>
                                                            <Track.Thumb>
                                                                <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                    <Custom:SurfaceThumb.BorderBrush>
                                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                            <GradientStop Color="#66000000" Offset="0"/>
                                                                            <GradientStop Color="#33000000" Offset="1"/>
                                                                        </LinearGradientBrush>
                                                                    </Custom:SurfaceThumb.BorderBrush>
                                                                    <Custom:SurfaceThumb.Style>
                                                                        <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                            <Setter Property="Background">
                                                                                <Setter.Value>
                                                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                        <GradientStop Color="#66000000" Offset="0"/>
                                                                                        <GradientStop Color="#33000000" Offset="1"/>
                                                                                    </LinearGradientBrush>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                            <Setter Property="BorderBrush">
                                                                                <Setter.Value>
                                                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                        <GradientStop Color="#19000000" Offset="1"/>
                                                                                    </LinearGradientBrush>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                            <Setter Property="Template">
                                                                                <Setter.Value>
                                                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                        <ControlTemplate.Resources>
                                                                                            <Storyboard x:Key="Press">
                                                                                                <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                            </Storyboard>
                                                                                            <Storyboard x:Key="Release">
                                                                                                <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                            </Storyboard>
                                                                                        </ControlTemplate.Resources>
                                                                                        <Grid x:Name="Grid" Background="Transparent" Height="Auto" SnapsToDevicePixels="True" Width="{TemplateBinding MinWidth}">
                                                                                            <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="Auto" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch"/>
                                                                                            <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Height="Auto" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                                                <Rectangle.Fill>
                                                                                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                                                                        <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                        <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Rectangle.Fill>
                                                                                                <Rectangle.Stroke>
                                                                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                        <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                        <GradientStop Color="#19000000" Offset="1"/>
                                                                                                    </LinearGradientBrush>
                                                                                                </Rectangle.Stroke>
                                                                                            </Rectangle>
                                                                                            <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                        </Grid>
                                                                                        <ControlTemplate.Triggers>
                                                                                            <Trigger Property="IsFocused" Value="True"/>
                                                                                            <Trigger Property="IsDragging" Value="True">
                                                                                                <Trigger.EnterActions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                            <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </Trigger.EnterActions>
                                                                                                <Trigger.ExitActions>
                                                                                                    <BeginStoryboard>
                                                                                                        <Storyboard>
                                                                                                            <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                            <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                        </Storyboard>
                                                                                                    </BeginStoryboard>
                                                                                                </Trigger.ExitActions>
                                                                                            </Trigger>
                                                                                            <Trigger Property="IsEnabled" Value="False">
                                                                                                <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                            </Trigger>
                                                                                        </ControlTemplate.Triggers>
                                                                                    </ControlTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </Custom:SurfaceThumb.Style>
                                                                </Custom:SurfaceThumb>
                                                            </Track.Thumb>
                                                        </Track>
                                                    </Border>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                        <Trigger.EnterActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                    <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </Trigger.EnterActions>
                                                        <Trigger.ExitActions>
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Width" Storyboard.TargetName="TrackBkgd"/>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </Trigger.ExitActions>
                                                    </Trigger>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                        <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                        <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                        <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Style.Triggers>
                                        <Trigger Property="Orientation" Value="Horizontal">
                                            <Setter Property="Width" Value="Auto"/>
                                            <Setter Property="MinWidth" Value="30"/>
                                            <Setter Property="Height" Value="30"/>
                                            <Setter Property="MinHeight" Value="30"/>
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#33364E5C" Offset="0"/>
                                                        <GradientStop Color="#0C364E5C" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="VerticalAlignment" Value="Stretch"/>
                                            <Setter Property="HorizontalAlignment" Value="Stretch"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type Custom:SurfaceScrollBar}">
                                                        <ControlTemplate.Resources>
                                                            <Storyboard x:Key="Touch">
                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                            </Storyboard>
                                                            <Storyboard x:Key="Release">
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                            </Storyboard>
                                                        </ControlTemplate.Resources>
                                                        <Grid x:Name="GridRoot" Background="Transparent" Height="Auto" MinWidth="30" MinHeight="30" SnapsToDevicePixels="True">
                                                            <Rectangle x:Name="TrackBkgd" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Height="8" RadiusY="4" RadiusX="4" Stroke="{TemplateBinding BorderBrush}" VerticalAlignment="Stretch" Width="Auto"/>
                                                            <Border x:Name="Track" Background="Transparent" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" VerticalAlignment="Stretch">
                                                                <Track x:Name="PART_Track" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                                                    <Track.DecreaseRepeatButton>
                                                                        <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageLeftCommand" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceRepeatButton.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                    <Setter Property="IsTabStop" Value="False"/>
                                                                                    <Setter Property="Focusable" Value="False"/>
                                                                                    <Setter Property="Interval" Value="300"/>
                                                                                    <Setter Property="Padding" Value="-5"/>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                <Grid>
                                                                                                    <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceRepeatButton.Style>
                                                                        </Custom:SurfaceRepeatButton>
                                                                    </Track.DecreaseRepeatButton>
                                                                    <Track.IncreaseRepeatButton>
                                                                        <Custom:SurfaceRepeatButton Background="Transparent" Command="ScrollBar.PageRightCommand" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceRepeatButton.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                                                    <Setter Property="IsTabStop" Value="False"/>
                                                                                    <Setter Property="Focusable" Value="False"/>
                                                                                    <Setter Property="Interval" Value="300"/>
                                                                                    <Setter Property="Padding" Value="-5"/>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceRepeatButton}">
                                                                                                <Grid>
                                                                                                    <Rectangle Fill="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceRepeatButton.Style>
                                                                        </Custom:SurfaceRepeatButton>
                                                                    </Track.IncreaseRepeatButton>
                                                                    <Track.Thumb>
                                                                        <Custom:SurfaceThumb x:Name="Thumb" Background="White" MinWidth="8" MinHeight="8" SnapsToDevicePixels="True">
                                                                            <Custom:SurfaceThumb.BorderBrush>
                                                                                <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                                                </LinearGradientBrush>
                                                                            </Custom:SurfaceThumb.BorderBrush>
                                                                            <Custom:SurfaceThumb.Style>
                                                                                <Style TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                    <Setter Property="Background">
                                                                                        <Setter.Value>
                                                                                            <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                                                                <GradientStop Color="#66000000" Offset="0"/>
                                                                                                <GradientStop Color="#33000000" Offset="1"/>
                                                                                            </LinearGradientBrush>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                    <Setter Property="BorderBrush">
                                                                                        <Setter.Value>
                                                                                            <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                                                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                <GradientStop Color="#19000000" Offset="1"/>
                                                                                            </LinearGradientBrush>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="{x:Type Custom:SurfaceThumb}">
                                                                                                <ControlTemplate.Resources>
                                                                                                    <Storyboard x:Key="Press">
                                                                                                        <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                        <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                    </Storyboard>
                                                                                                    <Storyboard x:Key="Release">
                                                                                                        <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                        <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                    </Storyboard>
                                                                                                </ControlTemplate.Resources>
                                                                                                <Grid x:Name="Grid" Background="Transparent" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Width="Auto">
                                                                                                    <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" VerticalAlignment="Stretch" Width="Auto"/>
                                                                                                    <Rectangle x:Name="RenderOverlay" HorizontalAlignment="Stretch" Margin="1" RadiusY="3" RadiusX="3" SnapsToDevicePixels="True" VerticalAlignment="Stretch" Width="Auto">
                                                                                                        <Rectangle.Fill>
                                                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                                                <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                                                                <GradientStop Color="#0C000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Rectangle.Fill>
                                                                                                        <Rectangle.Stroke>
                                                                                                            <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                                                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                                                                <GradientStop Color="#19000000" Offset="1"/>
                                                                                                            </LinearGradientBrush>
                                                                                                        </Rectangle.Stroke>
                                                                                                    </Rectangle>
                                                                                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" IsHitTestVisible="True" Margin="-1" Opacity="0"/>
                                                                                                </Grid>
                                                                                                <ControlTemplate.Triggers>
                                                                                                    <Trigger Property="IsFocused" Value="True"/>
                                                                                                    <Trigger Property="IsDragging" Value="True">
                                                                                                        <Trigger.EnterActions>
                                                                                                            <BeginStoryboard>
                                                                                                                <Storyboard>
                                                                                                                    <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                    <ThicknessAnimation Duration="0:0:0.1" To="-3" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                </Storyboard>
                                                                                                            </BeginStoryboard>
                                                                                                        </Trigger.EnterActions>
                                                                                                        <Trigger.ExitActions>
                                                                                                            <BeginStoryboard>
                                                                                                                <Storyboard>
                                                                                                                    <DoubleAnimation Duration="0:0:0.15" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Glow"/>
                                                                                                                    <ThicknessAnimation Duration="0:0:0.15" From="-3" To="-1" Storyboard.TargetProperty="Margin" Storyboard.TargetName="Glow"/>
                                                                                                                </Storyboard>
                                                                                                            </BeginStoryboard>
                                                                                                        </Trigger.ExitActions>
                                                                                                    </Trigger>
                                                                                                    <Trigger Property="IsEnabled" Value="False">
                                                                                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                                                                    </Trigger>
                                                                                                </ControlTemplate.Triggers>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>
                                                                            </Custom:SurfaceThumb.Style>
                                                                        </Custom:SurfaceThumb>
                                                                    </Track.Thumb>
                                                                </Track>
                                                            </Border>
                                                        </Grid>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="Custom:TouchExtensions.AreAnyInputDevicesCapturedWithin" Value="True">
                                                                <Trigger.EnterActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="30" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                            <DoubleAnimation Duration="0:0:0.1" To="12" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </Trigger.EnterActions>
                                                                <Trigger.ExitActions>
                                                                    <BeginStoryboard>
                                                                        <Storyboard>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="Height" Storyboard.TargetName="TrackBkgd"/>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinHeight" Storyboard.TargetName="Thumb"/>
                                                                            <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetProperty="MinWidth" Storyboard.TargetName="Thumb"/>
                                                                        </Storyboard>
                                                                    </BeginStoryboard>
                                                                </Trigger.ExitActions>
                                                            </Trigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                                <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                                                <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                                                <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                                                <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Custom:SurfaceScrollBar.Style>
                        </Custom:SurfaceScrollBar>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="IsEnabled" TargetName="PART_HorizontalScrollBar" Value="False"/>
                            <Setter Property="IsEnabled" TargetName="PART_VerticalScrollBar" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type CustomControl:ScrumTableScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}"/>
    <Style TargetType="{x:Type Custom:SurfaceScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}"/>
  

</ResourceDictionary>